<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />

		<title>刊例投放</title>

		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link rel="stylesheet" type="text/css"
			href="<%=path%>/css/common.css" />
		<link rel="stylesheet" type="text/css" href="<%=path%>/css/tag.css" />
		<link rel="stylesheet" type="text/css" 
			href="<%=path%>/js/jquery-ui-1.8.21.custom/css/smoothness/jquery-ui-1.8.21.custom.css" />
		<script type="text/javascript" src="<%=path%>/js/jquery-1.7.2.js"></script>
		<script type="text/javascript"
			src="<%=path%>/js/jquery-ui-1.8.21.custom/js/jquery-ui-1.8.21.custom.min.js"></script>
		<script type="text/javascript"
			src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){  
			   //禁止退格键 作用于Firefox、Opera    
			    document.onkeypress = banBackSpace;  
			   //禁止退格键 作用于IE、Chrome   
				  document.onkeydown = banBackSpace;  
			});
			//处理键盘事件 禁止后退键（Backspace）密码或单行、多行文本框除外 
			function banBackSpace(e){
				//alert(event.keyCode)
			    var ev = e || window.event;//获取event对象   
			    var obj = ev.target || ev.srcElement;//获取事件源     
			    var t = obj.type || obj.getAttribute('type');//获取事件源类型     
			    //获取作为判断条件的事件类型 
			    var vReadOnly = obj.readOnly;
			    var vDisabled = obj.disabled;
			    //处理undefined值情况 
			    vReadOnly = (vReadOnly == undefined) ? false : vReadOnly;
			    vDisabled = (vDisabled == undefined) ? true : vDisabled;
			    //当敲Backspace键时，事件源类型为密码或单行、多行文本的，  
			    //并且readOnly属性为true或disabled属性为true的，则退格键失效  
			    var flag1 = ev.keyCode == 8 && (t == "password" || t == "text" || t == "textarea") && (vReadOnly == true || vDisabled == true);
			    //当敲Backspace键时，事件源类型非密码或单行、多行文本的，则退格键失效    
			    var flag2 = ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea";
			    //判断    
			    if (flag2 || flag1) 
			        ev.returnValue = false;//这里如果写 return false 无法实现效果 
			}
			
			function pageSub(currentPage) {
				var reg = /^\d*?$/;
				var total = ${page.totalPages};
				if(reg.test(currentPage)){
				 	if(currentPage > total){
				 		currentPage = total;
					 }
					 $("#currentPage").val(currentPage);
					 $('#form1').submit();
				} else {
					alert("请输入数字!");
				}
			}
			function submitForm(){
				var flag = true;				
				var projectStartTime = $("#projectStartTime1").val();
				var projectEndTime = $("#projectEndTime1").val();
				var mediumResourceType = $("#mediumResourceType1").val();
				var mediumStatus = $("#mediumStatus1").val();
				var city = $("#city1").val();
				var keywordType = $("#keywordType1").val();
				var keyword = $.trim($("#keyword1").val());
				var projectType = $("#projectType1").val();
				//验证
				if(projectStartTime != "" && projectEndTime != ""){
					if(projectStartTime.replace("-","") > projectEndTime.replace("-","")){
						alert("开始日期要小于结束日期！");
						flag = false;
					}
				}else if(projectStartTime == "" && projectEndTime != ""){
					alert("开始日期不能为空！");
					flag = false;					
				}else if(projectStartTime != "" && projectEndTime == ""){
					alert("结束日期不能为空！");
					flag = false;
				}
				//
				if(keywordType != ""){
					if(keyword == ""){
						alert("关键字不能为空！");
						flag = false;
					}else if(keyword.length > 20){
						alert("关键字长度超过20个字符！");
						flag = false;
					}else{
						var reg = /^[\s\dA-Za-z\u4E00-\u9FA5]+$/;
						if(!reg.test(keyword)){
							alert("关键字中含有非法字符！");
							flag = false;
						}
					}
				}
				if(keyword != "" && keyword != "输入关键字检索" && keywordType == ""){
					alert("没有选择关键字类型！");
					flag = false;
				}
				if(flag){
					//赋值
					$("#projectStartTime").val(projectStartTime);
					$("#projectEndTime").val(projectEndTime);
					$("#mediumResourceType").val(mediumResourceType);
					$("#mediumStatus").val(mediumStatus);
					$("#city").val(city);
					$("#keywordType").val(keywordType);
					$("#keyword").val(keyword);
					$("#projectType").val(projectType);
					//提交
					$('#form1').submit();
				}
			}
			function resetForm(){
				var city1 = "${logUser.usercity}";
				if(city1 == null){
					city1 = "DG";
				} 
				$("#projectStartTime1").val("");
				$("#projectEndTime1").val("");
				$("#mediumResourceType1").val("");
				$("#mediumStatus1").val("");
				$("#city1").val(city1);
				$("#keywordType1").val("");
				$("#keyword1").val("输入关键字检索");
				$("#projectType1").val("");
			}
			$(function(){
		        //selectNav('nav4');
		        //
		        $("#deleteBudgetDialog").dialog({
					autoOpen: false,
					modal: true,
					width: 1200,
					height: 500,
					title: "投放明细详情",
					resizable: false,
					show: "blind",
					hide: "slide"
				});
				//
				
				//
				$("a[class^='detailBudget_']").click(function(){
					//			
					var id = $(this).attr("class").split("_")[1];
					$("#dialog_materialArray").empty();
					$("#dialog_arrangements").empty().append("<br />");
					$("#dialog_charges").empty();
					$("#dialog_runLog").empty();
					$.ajax({
						type: "post",
						url: "ajaxCastDetail.action",
						data: {proMedID:id},
						success: function(result, textStatus){
							if(result.ajaxFlag){
								var castDetail = result.castDetail;
								if(castDetail != null){
									$("#dialog_projectName").text(castDetail.projectName);
									$("#dialog_arrangeTime").text(castDetail.arrangeTime);
									$("#dialog_mediaName").text(castDetail.mediaName);
									$("#dialog_mediumName").text(castDetail.mediumName);
									$("#dialog_mediumStatus").text(castDetail.mediumStatus);
									// 项目刊例
									var projectMedium = result.pm;
									$("#dialog_mediumPrice").text(projectMedium.mediumID);
									$("#dialog_mediumAmount").text(projectMedium.mediumAmount);
									$("#dialog_mediumOrientDiscount").text(projectMedium.mediumOrientDiscount);
									$("#dialog_mediumTotalPrice").text(projectMedium.mediumTotalPrice);
									$("#dialog_mediumTotalDisprice").text(projectMedium.mediumTotalDisprice);
									// 物料
									/*
									var materialArray = castDetail.id_materialArray;
									if(materialArray == null || materialArray.length ==0){
										var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;无</li>"
											$("#dialog_materialArray").append(html);
									}else{
										for(i=0;i<materialArray.length;i++){
											var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;"+(i+1)+".&nbsp;&nbsp;"+materialArray[i]+"</li>"
											$("#dialog_materialArray").append(html);
										}
									}
									*/
									var materialsArray = castDetail.materialsArray;
									if(materialsArray == null || materialsArray.length ==0){
										var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;无</li>"
											$("#dialog_materialArray").append(html);
									}else{
										for(i=0;i<materialsArray.length;i++){
											var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;"+(i+1)+".&nbsp;&nbsp;<a href=\"materialDetailAction.action?matId="+materialsArray[i][0]+"\" class=\"underline\" style=\"color: #666666;\" >"+materialsArray[i][1]+"</a></li>"
											$("#dialog_materialArray").append(html);
										}
									}
									//排期
									var initArrangements = result.initArrangements;
									for(j=0;j<initArrangements.length;j++){
										var html = "<table id=\"m_"+initArrangements[j].month+"_close\" class=\"table_list\" style=\"margin: 0 auto;\">";
										var dates = initArrangements[j].dates;
										html += "<tr><th rowspan=\"2\" style=\"width: 30px;background: #f37c20;\">"+initArrangements[j].month+"<br />月</th>";
										for(m=0;m<dates.length;m++){
											if(dates[m].isShow == 2){
												html += "<td style=\"width: 31px;\"></td>"
											}else{
												html += "<td style=\"width: 31px; color: #000000;\">"+(m+1)+"</td>"
											}
										}
										html += "<th rowspan=\"2\" style=\"width: 91px; background: #f37c20;\"><a class=\"openButton operation\" style=\"float: none;\">展开</a>	</th></tr>"
										html += "<tr>";
										for(n=0;n<dates.length;n++){
											if(dates[n].isShow == 0){
												html += "<td>"+dates[n].initValue +"</td>"
											}else if(dates[n].isShow == 1){
												html += "<td>-</td>"
											}else{
												html += "<td></td>"
											}
										}
										html += "</tr>";
										html += "</table>";
										
										html += "<table id=\"m_"+initArrangements[j].month+"_open\" class=\"table_list\" style=\"margin: 0 auto;display: none;\">";
										
										html += "<tr><th colspan=\"31\" style=\"background: #f37c20;\">"+initArrangements[j].month+"月<a class=\"closeButton operation\" style=\"margin-right: 30px;\">收起</a></th></tr>";
										
										html += "<tr>";
										for(x=0;x<dates.length;x++){
											if(dates[x].isShow == 2){
												html += "<td style=\"width: 35px;"+dates[x].style+"\"></td>"
											}else{
												html += "<td style=\"width: 35px;color: #000000;"+dates[x].style+"\">"+dates[x].day+"</td>"
											}
										}
										html += "</tr>";
										
										html += "<tr>";
										for(y=0;y<dates.length;y++){
											if(dates[y].isShow == 2){
												html += "<td style=\""+dates[y].style+"\"></td>"
											}else{
												html += "<td style=\"color: #000000;"+dates[y].style+"\">"+(y+1)+"</td>"
											}
										}
										html += "</tr>";
										
										html += "<tr>";
										for(z=0;z<dates.length;z++){
											if(dates[z].isShow == 0){
												html += "<td style=\""+dates[z].style+"\">"+dates[z].initValue +"</td>"
											}else if(dates[z].isShow == 1){
												html += "<td style=\""+dates[z].style+"\">-</td>"
											}else{
												html += "<td style=\""+dates[z].style+"\"></td>"
											}
										}
										html += "</tr>";
										
										html += "</table>";
										
										html += "<br />";
										$("#dialog_arrangements").append(html);
										// 费用
										var charges = result.charges;
										if(charges == null || charges.length == 0){
											$("#dialog_charges").empty();
											html = "<tr  style=\"text-align:left;\">";
											html += "<td style=\"border-style:none;\">&nbsp;&nbsp;&nbsp;&nbsp;无</td>";
											html += "</tr>";
											$("#dialog_charges").append(html);
										}else{
											$("#dialog_charges").empty();
											html = "";
											for(k=0;k<charges.length;k++){
												if(k == 0){
													html += "<tr style=\"background:#f2f2f2;\">";
													html += "<th style=\"width:20%;border-style:none dashed dashed none;\">费用类型</th>";
													html += "<th style=\"width:20%;border-style:none dashed dashed;\">费用子类</th>";
													html += "<th style=\"width:20%;border-style:none dashed dashed;\">资金类型</th>";
													html += "<th style=\"width:20%;border-style:none dashed dashed;\">使用折扣率(%)</th>";
													html += "<th style=\"width:20%;border-style:none none dashed dashed;\">计量计返类型</th>";
													html += "</tr>";
												}else{
													html += "<tr style=\"background:#f2f2f2;\">";
													html += "<th style=\"width: 20%;border-style:solid dashed dashed none;\">费用类型</th>";
													html += "<th style=\"width: 20%;border-style:solid dashed dashed;\">费用子类</th>";
													html += "<th style=\"width: 20%;border-style:solid dashed dashed;\">资金类型</th>";
													html += "<th style=\"width: 20%;border-style:solid dashed dashed;\">使用折扣率(%)</th>";
													html += "<th style=\"width: 20%;border-style:none none dashed dashed;\">计量计返类型</th>";
													html += "</tr>";
												}
												
												//
												html += "<tr>";
												html += "<td style=\"border-style:dashed dashed dashed none;\">"+charges[k].costType+"</td>";
												html += "<td style=\"border-style:dashed\">"+charges[k].costSubtype+"</td>";
												html += "<td style=\"border-style:dashed\">"+charges[k].fundType+"</td>";
												html += "<td style=\"border-style:dashed\">"+charges[k].usedRatio+"</td>";
												html += "<td style=\"border-style:dashed none dashed dashed;\">"+charges[k].jljfType+"</td>";
												html += "</tr>";
												
												
												
												if(charges[k].fundType == "常规价格特殊折扣存放"){
													html += "<tr style=\"background:#f2f2f2;\">";
													html += "<th style=\"border-style:dashed dashed dashed none;\">特殊报价</th>";
													html += "<th style=\"border-style:dashed;\">特殊报价数量</th>";
													html += "<th style=\"border-style:dashed;\">本次抵扣刊例金额</th>";
													html += "<th style=\"border-style:dashed;\">本次实际使用金额</th>";
													html += "<th style=\"border-style:dashed none dashed dashed;\"></th>";
													html += "</tr>";
													if(k == (charges.length-1)){
														html += "<tr>";
														html += "<td style=\"border-style:dashed dashed none none;\">"+charges[k].tsbjType+"</td>";
														html += "<td style=\"border-style:dashed dashed none\">"+charges[k].tsbjAmount+"</td>";
														html += "<td style=\"border-style:dashed dashed none\">"+charges[k].bcdkkanli+"</td>";
														html += "<td style=\"border-style:dashed dashed none\">"+charges[k].fundAmount+"</td>";
														html += "<td style=\"border-style:dashed none none dashed;\"></td>";
														html += "</tr>";
													}else{
														html += "<tr>";
														html += "<td style=\"border-style:dashed dashed solid none;\">"+charges[k].tsbjType+"</td>";
														html += "<td style=\"border-style:dashed dashed solid\">"+charges[k].tsbjAmount+"</td>";
														html += "<td style=\"border-style:dashed dashed solid\">"+charges[k].bcdkkanli+"</td>";
														html += "<td style=\"border-style:dashed dashed solid\">"+charges[k].fundAmount+"</td>";
														html += "<td style=\"border-style:dashed none solid dashed;\"></td>";
														html += "</tr>";
													}
												}else{
													html += "<tr style=\"background:#f2f2f2;\">";
													html += "<th style=\"border-style:dashed dashed dashed none;\">本次抵扣刊例金额</th>";
													html += "<th style=\"border-style:dashed;\">本次实际使用金额</th>";
													html += "<th style=\"border-style:dashed;\"></th>";
													html += "<th style=\"border-style:dashed;\"></th>";
													html += "<th style=\"border-style:dashed none dashed dashed;\"></th>";
													html += "</tr>";
													if(k == (charges.length-1)){
														html += "<tr>";
														html += "<td style=\"border-style:dashed dashed none none;\">"+charges[k].bcdkkanli+"</td>";
														html += "<td style=\"border-style:dashed dashed none\">"+charges[k].fundAmount+"</td>";
														html += "<td style=\"border-style:dashed dashed none\"></td>";
														html += "<td style=\"border-style:dashed dashed none\"></td>";
														html += "<td style=\"border-style:dashed none none dashed;\"></td>";
														html += "</tr>";
													}else{
														html += "<tr>";
														html += "<td style=\"border-style:dashed dashed solid none;\">"+charges[k].bcdkkanli+"</td>";
														html += "<td style=\"border-style:dashed dashed solid\">"+charges[k].fundAmount+"</td>";
														html += "<td style=\"border-style:dashed dashed solid\"></td>";
														html += "<td style=\"border-style:dashed dashed solid\"></td>";
														html += "<td style=\"border-style:dashed none solid dashed;\"></td>";
														html += "</tr>";
													}
												}
											}
											$("#dialog_charges").append(html);
										}
										//日志dialog_runLog
										var logList = result.logList;
										if(logList == null || logList.length == 0){
											$("#dialog_runLog").empty();
											var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;无</li>"
											$("#dialog_runLog").append(html);
										}else{
											$("#dialog_runLog").empty();
											for(i=0;i<logList.length;i++){
												var html = "<li style=\"height:30px; line-height:30px;\">&nbsp;&nbsp;&nbsp;&nbsp;"+logList[i].content+"</li>"
												$("#dialog_runLog").append(html);
											}
										}
									}
								}
								$(".operation").css("color","#0078b6");
								$(".operation").mouseover(function(){
									$(this).css("color","#ffffff");
									$(this).css("background","#0078b6");
								});
								$(".operation").mouseout(function(){
									$(this).css("color","#0078b6");
									$(this).css("background","");
								});
								$(".closeButton").click(function(){
									var openId = $(this).parent().parent().parent().parent().attr("id");
									var closeId = openId.replace("open", "close");
									$("#"+openId).hide();
									$("#"+closeId).show();
								});
								$(".openButton").click(function(){
									var closeId = $(this).parent().parent().parent().parent().attr("id");
									var openId = closeId.replace("close", "open");
									$("#"+closeId).hide();
									$("#"+openId).show();
								});
								//显示弹框
								$("#deleteBudgetDialog").dialog("open");
							}else{
								//alert("该条数据出现异常！");
                				window.location.href='castDetailRecordException';
							}
						}
					});
				});
		    });
		</script>
	</head>

	<body>
		<!-- 顶栏start -->
		<jsp:include page="/jsp/common/top.jsp"></jsp:include> 
		<!-- 顶栏end -->
	
		<!-- 顶部start -->
		<div id="main">
			<div class="body">
				<!-- 导航菜单 -->
				<jsp:include page="../common/nav.jsp"></jsp:include>
				<!-- 主体 -->
				<div class="main_body">
					<form id="form1" action="mediumCastDetailList.action" method="post">
					<table class="condition bg1"
						style="width: 100%; font-size: 14px; font-weight: bold; color: #000000;"
						align="center">
						<tr>
							<td style="height: 40px;">
								&nbsp;&nbsp;&nbsp;&nbsp;
								<label>
									时间段：
								</label>
								<input type="text" id="projectStartTime1" class="text Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM'})" value="${projectStartTime }" readonly="readonly" />
								-
								<input type="text" id="projectEndTime1" class="text Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM'})" value="${projectEndTime }" readonly="readonly" />
							</td>
							<td style="height: 40px;">
								<s:select id="mediumResourceType1" list="mediaResourceTypeSelect" listKey="id" listValue="datavalue" headerKey="" headerValue="--资源类型--" value="mediumResourceType"></s:select>
								&nbsp;&nbsp;&nbsp;&nbsp;
								<s:select id="mediumStatus1" list="mediumStatusSelect" listKey="id" listValue="datavalue" headerKey="" headerValue="--资源占用状态--" value="mediumStatus"></s:select>
								&nbsp;&nbsp;&nbsp;&nbsp;
								<s:select id="city1" list="citySelect" listKey="id" listValue="datavalue" value="city"></s:select>
								<!--  
								&nbsp;&nbsp;&nbsp;&nbsp;
								<select id="">
									<option>
										--(全)部门科室--
									</option>
									<option>
										市场部服务管理室
									</option>
								</select>
								-->
							</td>
							<td></td>
						</tr>
						<tr>
							<td width="34%" style="height: 40px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关键字：
								<s:select id="keywordType1" list="#{1:'按项目名称',2:'按项目负责人'}" listKey="key" listValue="value"  headerKey="" headerValue="--关键字检索类型--" value="keywordType"></s:select>
								&nbsp;
								<s:if test="keyword == null || keyword == ''">
									<input id="keyword1" type="text" class="text" value="输入关键字检索" onfocus="if($(this).val() == '输入关键字检索'){$(this).val('');}" />
								</s:if>
								<s:else>
									<input id="keyword1" type="text" class="text" value="${keyword }" onfocus="if($(this).val() == '输入关键字检索'){$(this).val('');}" />
								</s:else>
							</td>
							<td width="60%" style="height: 40px; text-align: left;">
								<s:select id="projectType1" list="projectTypeSelect" listKey="id" listValue="datavalue" headerKey="" headerValue="--项目类型--" value="projectType"></s:select>
								&nbsp;&nbsp;&nbsp;
								<input type="button" class="btn-title" value="搜索" onclick="submitForm();" />
								&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="button" class="btn-title" value="重置" onclick="resetForm();" />
							</td>
							<td style="height: 40px; text-align: right;">
								<s:if test="userRoleRange == 1 || userRoleRange == 2 || userRoleRange == 3 ">
									<input type="button" class="btn-title" value="新增"
										onclick="window.location.href='initCastDetailHome.action';" />
								</s:if>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							</td>
						</tr>
					</table>
					<input type="hidden" id="currentPage" name="currentPage" />
					<input type="hidden" id="projectStartTime" name="projectStartTime" value="${projectStartTime }" />
					<input type="hidden" id="projectEndTime" name="projectEndTime" value="${projectEndTime }" />
					<input type="hidden" id="mediumResourceType" name="mediumResourceType" value="${mediumResourceType }" />
					<input type="hidden" id="mediumStatus" name="mediumStatus" value="${mediumStatus }" />
					<input type="hidden" id="city" name="city" value="${city }" />
					<input type="hidden" id="keywordType" name="keywordType" value="${keywordType }" />
					<input type="hidden" id="keyword" name="keyword" value="${keyword }" />
					<input type="hidden" id="projectType" name="projectType" value="${projectType }" />
					</form>

					<div id="list_div">
						<table class="table_list" style="width: 100%;">
							<tr class="bg">
								<th>
									项目名称
								</th>
								<th>
									媒体名称
								</th>
								<th>
									刊例名称
								</th>
								<th>
									资源类型
								</th>
								<th>
									<!--  <a href="resStatePreviewList.action?mediumStatus=1" class='underline' style="color: #000000;">资源占用状态</a>-->
									资源占用状态
								</th>
								<th>
									赠送类型
								</th>
								<th>
									定向折扣(%)
								</th>
								<th>位置</th>
								<th>
									刊例价
								</th>
								<th>
									物料编号
								</th>
								<th>
									排期时间
								</th>
								<th>
									操作
								</th>
							</tr>
							<s:iterator status="" value="castDetails">
								<s:if test="#stu.even">
					  				<tr class="">
						  		</s:if>
						  		<s:else>
						  			<tr>
						  		</s:else>
									<td>
										<a href="proDetail.action?projectId=${projectID }" class="underline" title="${projectName }">
											<s:if test="projectName.length() > 10">
												<s:property value="projectName.substring(0,10)" />
											</s:if>
											<s:else>
												<s:property value="projectName" />
											</s:else>
										</a>
									</td>
									<td>
										<a href="mediumDetailAction.action?priceID=${priceID }" class="underline" title="${mediaName }">
											<s:if test="mediaName.length() > 10">
												<s:property value="mediaName.substring(0,10)" />
											</s:if>
											<s:else>
												<s:property value="mediaName" />
											</s:else>
										</a>
									</td>
									<td>
										<a href="toMediumDetailsAction.action?id=${id_medium }" class="underline" title="${mediumName }">
											<s:if test="mediumName.length() > 10">
												<s:property value="mediumName.substring(0,10)" />
											</s:if>
											<s:else>
												<s:property value="mediumName" />
											</s:else>
										</a>
									</td>
									<td>
										<s:iterator value="mediaResourceTypeSelect">
											<s:if test="mediaResourceType == id">
												${datavalue }
											</s:if>
										</s:iterator>
									</td>
									<td>
										<s:iterator value="mediumStatusSelect">
											<s:if test="mediumStatus == id">
												${datavalue }
											</s:if>
										</s:iterator>
									</td>
									<td>
										<s:iterator value="mediumPromotionTypeSelect">
											<s:if test="mediumPromotionType == id">
												${datavalue }
											</s:if>
										</s:iterator>
									</td>
									<td>
										${mediumOrientDiscount }
									</td>
									<td title="${mediumPosition }">
										<s:if test="mediumPosition.length() > 10">
											<s:property value="mediumPosition.substring(0,10)" />
										</s:if>
										<s:else>
											<s:property value="mediumPosition" />
										</s:else>
									</td>
									<td>
										<fmt:formatNumber value="${mediumPrice }"></fmt:formatNumber>
									</td>
									<td style="width: 100px;">
										<s:if test="null != materialsArray">
										<s:iterator status="status" value="materialsArray">
											<a href="materialDetailAction.action?matId=<s:property value="materialsArray[#status.index][0]" />" class="underline" title="<s:property value="materialsArray[#status.index][1]" />">
												<s:if test="materialsArray[#status.index][1].length() > 10">
													<s:property value="materialsArray[#status.index][1].substring(0,10)" />
												</s:if>
												<s:else>
													<s:property value="materialsArray[#status.index][1]" />
												</s:else>
											</a>&nbsp;
										</s:iterator>
										</s:if>
										<s:else>无</s:else>
									</td>
									<td>
										<s:property value="arrangeTime" />
									</td>
									<td>  
										<s:if test="#session.logUser.usercity == city">
										<a href="initCastDetailHome.action?projectMedium.proMedID=${proMedID}" title="编辑">
											<img src="images/modify.gif" alt="编辑" />
										</a>
										<a class="detailBudget_${proMedID}" title="详情" style="cursor: pointer;">
											<img src="images/detail.gif" alt="详情" />
										</a>
										<a href="deleteCastDetail.action?projectMedium.proMedID=${proMedID}" title="删除" onclick="return confirm('确定删除该条记录吗？');"> 
											<img src="images/delete.gif" alt="删除" /> 
										</a>
										</s:if>
										<s:else>
											<a class="detailBudget_${proMedID}" title="详情" style="cursor: pointer;">
												<img src="images/detail.gif" alt="详情" />
											</a>
										</s:else>
									</td>
								</tr>
							</s:iterator>
						</table>
						<!-- 分页start -->
						<jsp:include page="/jsp/common/page.jsp"></jsp:include>
						<!-- 分页end -->
					</div>
				</div>
			</div>
		</div>
		<!-- 顶部end -->
		
		<!-- 底部start -->
		<jsp:include page="/jsp/common/bottom.jsp"></jsp:include> 
		<!-- 底部end -->
		<div id="deleteBudgetDialog" style="display: none;">
			<div id="list_div" style="padding-bottom: 7px;">
				<table class="table_list" style="width: 100%">
					<tr class="bg" style="border-left: 2px solid #f37c20;">
						<th colspan="13" style="font-size:15px; padding-left:18px;">基本信息</th>
					</tr>
					<tr style="background:#f2f2f2;">
						<th style="width: 20%;border-style:solid dashed dashed solid;">项目名称</th>
						<th style="width: 20%;border-style:solid dashed dashed;">排期时间</th>
						<th style="width: 20%;border-style:solid dashed dashed;">投放媒体</th>
						<th style="width: 20%;border-style:solid dashed dashed;">投放刊例</th>
						<th style="width: 20%;border-style:solid solid dashed dashed;">资源占用状态</th>
					</tr>
					<tr>
						<td id="dialog_projectName" style="border-style:dashed dashed dashed solid;"></td>
						<td id="dialog_arrangeTime" style="border-style:dashed dashed dashed;"></td>
						<td id="dialog_mediaName" style="border-style:dashed;"></td>
						<td id="dialog_mediumName" style="border-style:dashed;"></td>
						<td id="dialog_mediumStatus" style="border-style:dashed solid dashed dashed;"></td>
					</tr>
					<tr style="background:#f2f2f2;">
						<th style="width: 18%;border-style:dashed dashed dashed solid;">刊例价</th>
						<th style="width: 18%;border-style:dashed dashed dashed;">刊例价数量</th>
						<th style="width: 16%;border-style:dashed dashed dashed;">定向折扣(%)</th>
						<th style="width: 16%;border-style:dashed dashed dashed;">刊例总价</th>
						<th style="width: 16%;border-style:dashed dashed dashed;">折后刊例总价</th> 
					</tr>
					<tr>
						<td id="dialog_mediumPrice" style="border-style:dashed dashed solid solid;"></td>
						<td id="dialog_mediumAmount" style="border-style:dashed dashed solid;"></td>
						<td id="dialog_mediumOrientDiscount" style="border-style:dashed dashed solid;"></td>
						<td id="dialog_mediumTotalPrice" style="border-style:dashed dashed solid;"></td>
						<td id="dialog_mediumTotalDisprice" style="border-style:dashed dashed solid;"></td>
					</tr>
					<tr class="bg" style="border-left: 2px solid #f37c20;">
						<th colspan="13" style="font-size:15px; padding-left:18px;">物料信息</th>
					</tr>
					<tr style="text-align:left;">
						<td colspan="6">
							<ul id="dialog_materialArray"></ul>
						</td>
					</tr>
					<tr class="bg" style="border-left: 2px solid #f37c20;">
						<th colspan="13" style="font-size:15px; padding-left:18px;">排期信息</th>
					</tr>
					<tr style="text-align:left;">
						<td id="dialog_arrangements" colspan="6">
							<br />
						</td>
					</tr>
					<tr id="" class="bg" style="border-left: 2px solid #f37c20;">
						<th colspan="13" style="font-size:15px; padding-left:18px;">费用信息</th>
					</tr>
					
					<tr>
						<td colspan="6">
							<table id="dialog_charges" class="table_list" style="width: 100%"></table>
						</td>
					</tr>
					<tr class="bg" style="border-left: 2px solid #f37c20;">
						<th colspan="13" style="font-size:15px; padding-left:18px;">变更记录</th>
					</tr>
					<tr style="text-align:left;">
						<td colspan="6">
							<ul id="dialog_runLog"></ul>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</body>
</html>
